home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Tcl_ExprLong C Library Procedures Tcl_ExprLong
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBool, Tcl_ExprString -
- evaluate an expression
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ttccll..hh>>
-
- int |
- TTccll__EExxpprrLLoonngg(_i_n_t_e_r_p, _s_t_r_i_n_g, _l_o_n_g_P_t_r) |
-
- int |
- TTccll__EExxpprrDDoouubbllee(_i_n_t_e_r_p, _s_t_r_i_n_g, _d_o_u_b_l_e_P_t_r) |
-
- int |
- TTccll__EExxpprrBBoooolleeaann(_i_n_t_e_r_p, _s_t_r_i_n_g, _b_o_o_l_e_a_n_P_t_r) |
-
- int |
- TTccll__EExxpprrSSttrriinngg(_i_n_t_e_r_p, _s_t_r_i_n_g) |
-
- AARRGGUUMMEENNTTSS |
- Tcl_Interp *_i_n_t_e_r_p (in) ||
- Interpreter in whose con- |
- text to evaluate _s_t_r_i_n_g. |
-
- char *_s_t_r_i_n_g (in) ||
- Expression to be evaluated. |
-
- long *_l_o_n_g_P_t_r (out) ||
- Pointer to location in |
- which to store the integer |
- value of the expression. |
-
- int *_d_o_u_b_l_e_P_t_r(out) ||
- Pointer to location in |
- which to store the |
- floating-point value of the |
- expression. |
-
- int *_b_o_o_l_e_a_n_P_t_r(out) ||
- Pointer to location in |
- which to store the 0/1 |
- boolean value of the |
- expression. |
- _________________________________________________________________ |
-
-
- DDEESSCCRRIIPPTTIIOONN |
- These four procedures all evaluate a string expression, |
- returning the result in one of four different forms. The |
- expression is given by the _s_t_r_i_n_g argument, and it can have |
-
-
-
- Sprite v1.0 1
-
-
-
-
-
-
- Tcl_ExprLong C Library Procedures Tcl_ExprLong
-
-
-
- any of the forms accepted by the eexxpprr command. The _i_n_t_e_r_p |
- argument refers to an interpreter used to evaluate the |
- expression (e.g. for variables and nested Tcl commands) and |
- to return error information. _I_n_t_e_r_p->_r_e_s_u_l_t is assumed to |
- be initialized in the standard fashion when any of the pro- |
- cedures are invoked. |
-
- For all of these procedures the return value is a standard |
- Tcl result: TTCCLL__OOKK means the expression was succesfully |
- evaluated, and TTCCLL__EERRRROORR means that an error occurred while |
- evaluating the expression. If TTCCLL__EERRRROORR is returned then |
- _i_n_t_e_r_p->_r_e_s_u_l_t will hold a message describing the error. If |
- an error occurs while executing a Tcl command embedded in |
- _s_t_r_i_n_g, then that error will be returned. |
-
- If the expression is successfully evaluated, then its value |
- will be returned in one of four forms, depending on which |
- procedure is invoked. TTccll__EExxpprrLLoonngg stores an integer value |
- at *_l_o_n_g_P_t_r. If the expression's actual value was a |
- floating-point number, then it is truncated to an integer. |
- If the expression's actual value was a non-numeric string |
- then an error is returned. |
-
- TTccll__EExxpprrDDoouubbllee stores a floating-point value at *_d_o_u_b_l_e_P_t_r. |
- If the expression's actual value was an integer, it is con- |
- verted to floating-point. If the expression's actual value |
- was a non-numeric string then an error is returned. |
-
- TTccll__EExxpprrBBoooolleeaann stores a 0/1 integer value at *_b_o_o_l_e_a_n_P_t_r. |
- If the expression's actual value was an integer or |
- floating-point number, then TTccll__EExxpprrBBoooolleeaann stores 0 at |
- *_b_o_o_l_e_a_n_P_t_r if the value was zero and 1 otherwise. If the |
- expression's actual value was a non-numeric string then an |
- error is returned. |
-
- TTccll__EExxpprrSSttrriinngg returns the value of the expression as a |
- string stored in _i_n_t_e_r_p->_r_e_s_u_l_t. If the expression's actual |
- value was an integer or floating-point number, then |
- TTccll__EExxpprrSSttrriinngg converts it to string (using sspprriinnttff with a |
- ``%d'' or ``%g'' converter). |
-
-
- KKEEYYWWOORRDDSS |
- boolean, double, evaluate, expression, integer, string
-
-
-
-
-
-
-
-
-
-
-
- Sprite v1.0 2
-
-
-
-